﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Eps.Ai.Common;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace InfonavaEye.model
{
    /// <summary>
    /// 钉盒模板
    /// </summary>
    public class BoxModel
    {
        private double _boxAngle = -9999;

        private int nailShape = 1;//1 脊柱钉类,2.创伤圆钉类,3.板棒类

        /// <summary>
        /// x轴速度
        /// </summary>
        private int speedX = Config.MOTOR_DEFAULT_SPEED;

        /// <summary>
        /// y轴速度
        /// </summary>
        private int speedY = Config.MOTOR_DEFAULT_SPEED;

        /// <summary>
        /// 光源亮度(0 ~ 255)
        /// </summary>
        private int lightLuminosity = Config.LIGHT_SOURCE_LUMINOSITY_DEFAULT;

        /// <summary>
        /// 钉盒模板编码
        /// </summary>
        [JsonProperty("box-code")]
        public string boxCode { get; set; }
        /// <summary>
        /// 跨区域识别是否暂停
        /// </summary>
        [JsonProperty("span-area-pause")]
        public bool spanAreaPause { get; set; }

        /// <summary>
        /// 钉盒模板名称
        /// </summary>
        [JsonProperty("box-name")]
        public string boxName { get; set; }

        /// <summary>
        /// 钉子形状( 1.脊柱钉类, 2.创伤圆钉类  3.板棒类  )
        /// </summary>
        [JsonProperty("nail-shape")]
        public int NailShape {
            get { return nailShape; }
            set { nailShape = value; }
        }

        /// <summary>
        ///  光源亮度(0 ~ 255)
        /// </summary>
        [JsonProperty("light-luminosity")]
        public int LightLuminosity
        {
            get { return lightLuminosity; }
            set { lightLuminosity = value; }
        }

        /// <summary>
        /// X轴速度
        /// </summary>
        public int SpeedX { get { return speedX; } set { speedX = value; } }

        /// <summary>
        /// Y轴速度
        /// </summary>
        public int SpeedY { get { return speedY; } set { speedY = value; } }

        /// <summary>
        /// 倾斜角度
        /// </summary>
        [JsonProperty("box-angle")]
        public double boxAngle
        {
            get
            {
                return this._boxAngle;
            }
            set
            {
                this._boxAngle = value;
            }
        }

        [JsonProperty("box-areas")]
        public List<BoxArea> boxAreas { get; set; }

    }

    /// <summary>
    /// 钉盒区域
    /// </summary>
    public class BoxArea
    {
        /// <summary>
        /// 区域-编码
        /// </summary>
        [JsonProperty("code")]
        public string code { get; set; }

        /// <summary>
        /// 区域-名称
        /// </summary>
        [JsonProperty("name")]
        public string name { get; set; }

        /// <summary>
        /// /区域-原点 (x,y,z) ,z代表焦距
        /// </summary>
        [JsonProperty("startPoint")]
        public Int32[] startPoint { get; set; }

        /// <summary>
        /// 区域-行数
        /// </summary>
        [JsonProperty("row-count")]
        public Int32 rowCount { get; set; }

        /// <summary>
        /// 区域-孔间距（x,y）
        /// </summary>
        [JsonProperty("holdPitch")]
        public Int32[] holdPitch { get; set; }

        /// <summary>
        /// 区域-列数
        /// </summary>
        [JsonProperty("column-count")]
        public Int32 columnCount { get; set; }

        /// <summary>
        /// 区域-列头
        /// </summary>
        [JsonProperty("column-title")]
        public string[] columnTitle { get; set; }

        /// <summary>
        ///  区域光源亮度(0 ~ 255)
        /// </summary>
        [JsonProperty("light-luminosity")]
        public int lightLuminosity
        {
            get;
            set;
        }
        /// <summary>
        /// 镜头倍率
        /// </summary>
        public int autoShotMagnification {
            get;
            set;
        }
        /// <summary>
        /// 是否旋转180度
        /// </summary>
        public bool twirl180 { get; set; }
    }
}
